import request from '../utils/request.js'

// 查询订单 订单处理
export const getOrderList = function(data) {
	return request({
		// 主表信息 单号数量出货
		url: '/jxc/queryDelivery',
		method: 'POST',
		data,
		header: {
			'content-type':'application/json'
		}
	})
}

// /jxc/report 发起报备

export const getServiceReport=function(data){
	return request({
		url: `/jxc/report/reportStart?no=chenjianen&jsondata=${data.jsondata}`,
		method: 'GET',
		data
	})
}

// 是否在报备库中
export const getOrderReport = function(data) {
	return request({
		url: '/jxc/report/validateInWarrant',
		method: 'post',
		data,
		header: {
			'content-type':'application/json'
		}
	})
}

// 分页查询报备订单明细数据接口搜索报备库列表/jxc/reportCrud/queryPageList
export const getReportPageList = function(data) {
	return request({
		url: '/jxc/reportCrud/queryReportDetailPageList',
		method: 'POST',
	})
}
// 根据报备单号查询报备库详情列表 /jxc/reportCrud/queryOrderReport
export const getDetailReportList = function(data) {
	return request({
		url: '/jxc/reportCrud/queryReportDetailList',
		method: 'POST',
	})
}
// 根据报备单号查询报备库列表 /jxc/reportCrud/queryOrderReport
export const getQueryOrderReport = function(data) {
	return request({
		url: '/jxc/reportCrud/queryOrderReport',
		method: 'POST',
	})
}

// 其他出库 根据代理商Customer
export const getProductList = function(data) {
	return request({
		url: '/jxc/getByOtherAndCustomer?page=1&limit=100000',
		method: 'POST',
		data,
		header: {
			'content-type':'application/json'
		}
	})
}

//出货查询 根据出货单号查询出货单明细
export const getDeviceByOrder = function(data) {
	return request({
		url: '/jxc/queryJxc',
		method: 'POST',
		data,
	})
}

// 批量入库
export const updateDeviceByOrder = function(data) {
	return request({
		url: '/jxc/updateDeliveryCodeByDocno',
		method: 'POST',
		data,
	})
}

// 入库
export const deviceInStorage = function(data) {
	return request({
		url: '/jxc/updateDeliveryCode',
		method: 'POST',
		data,
	})
}

// 创建其他机身码信息
export const inStorageDeviceOther = function(data) {
	return request({
		url: '/jxc/createOtherDeliveryCode',
		method: 'POST',
		data,
	})
}

// 出库
export const outStorageDeviceOther = function(data) {
	return request({
		url: '/jxc/updateOutDeliveryCode',
		method: 'POST',
		data,
	})
}

// 销售
export const saleDevice = function(data) {
	return request({
		url: '/jxc/updateSaleDeliveryCode',
		method: 'POST',
		data,
	})
}

 // 创建其他机身码信息
export const queryIsInStorage = function(data) {
	return request({
		url: '/jxc/isCreateOtherDeliveryCode',
		method: 'POST',
		data,
	})
}

///根据机身码和客户编号查询记录
export const getDeviceByCustomer = function(data) {
	return request({
		url: '/jxc/getByCodeAndCustomer',
		method: 'POST',
		data,
	})
}

// 根据机身码查询记录
export const getDevice = function(data) {
	return request({
		url: '/jxc/getByCode',
		method: 'POST',
		data,
	})
}
